
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%--<x:parse xml="${param.xmlstr}" var="xmlData" />--%>
<input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>

<input type="hidden" id="if_have_org" name="proposal/if_have_org">

<div class="t_bar"><span class="color_red">*</span>申报基地基本情况</div>
<table class="t_css" width="100%" id="base_case" border="0" cellpadding="0"
       cellspacing="1">
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>

    <tr>
        <td colspan="4" align="center" style="color: black">产业化基地基本情况</td>
    </tr>
    <tr class="li_1">
        <td align="right">申报主体名称（全称）：</td>
        <td align="left">
            <input type='text' name='proposal/zh_title' id='zh_title' style="width: 88%" class="input_css required maxlength:50" maxlength="50" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="申报主体名称（全称）">
        </td>
        <td align="right">申报主体类型：</td>
        <td>
            <c:set var="declare_type_value"><x:out select="$xmlData/data/proposal/declare_type_value" /></c:set>
            <c:set var="decl_type">
                {'grant_code':'<x:out select="$xmlData/data/proposal/decl_type" />','stat_year':'${statYear}'}
            </c:set>
            <input name="proposal/declare_type_value"  type="hidden" value="<x:out select="$xmlData/data/proposal/declare_type_value" />" />
            <input name="proposal/declare_type_name" class="required" label="申报主体类型" type="hidden" value="<x:out select="$xmlData/data/proposal/declare_type_name" />" />
            <cpt:select style="width: 100%;" id="declare_type" key="cyhjdba02" className="selectWidth2" onChange="initControlValue('declare_type');declareOther()" value="${declare_type_value}"></cpt:select>
            <input id="other"  maxlength="20" <c:if test="${declare_type_value eq 3}">style="display:block;width: 95%;" class="required" </c:if> <c:if test="${declare_type_value ne 3}">style="display:none;width: 95%;"</c:if> name="proposal/declare_type_other" value="<x:out select="$xmlData/data/proposal/declare_type_other" />" label="申报主体类型-->其他" >

        </td>
    </tr>
    <tr>
        <td align="right">通信地址：</td>
        <td align="left">
            <input type="text" name="proposal/address" style="width: 88%" maxlength="100" class="required" value="<x:out select="$xmlData/data/proposal/address" />" label="通信地址">
        </td>
        <td align="right">邮编：</td>
        <td align="left">
            <input type="text" name="proposal/postal_code" maxlength="50" class="required" value='<x:out select="$xmlData/data/proposal/postal_code" />' label="邮编">
        </td>
    </tr>
    <tr>
        <td align="right">法人代表：</td>
        <td align="left">
            <input type="text" name="proposal/legal_representative" maxlength="40" class="required" value='<x:out select="$xmlData/data/proposal/legal_representative" />' label="法人代表">
        </td>
        <td align="right">联系电话：</td>
        <td align="left">
            <input type="text" onfocus="InitInput.setNumber(this,11,0,0)" maxlength="11" class="input_css required mobile" value="<x:out select="$xmlData/data/proposal/frdb_mobile" />" name="proposal/frdb_mobile" label="法人代表-->联系电话">
        </td>
    </tr>
    <tr>
        <td align="right">拟申请成果产业化基地负责人：</td>
        <td>
            <span ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
        </td>
        <td align="right">联系电话：</td>
        <td>
            <span>
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>
            </span>
        </td>
    </tr>
    <tr>
        <td align="right">联系人：</td>
        <td align="left">
            <input  type="text" label="联系人" name="proposal/contact_psn_cname" class="input_css required" maxlength="30" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
        </td>
        <td align="right">联系电话：</td>
        <td align="left">
            <input type="text" label="联系人-->联系电话" name="proposal/contact_psn_mobile" class="input_css required mobile" onfocus="InitInput.setNumber(this,11,0,0)" maxlength="11" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
        </td>
    </tr>

    <tr>
        <td align="right">单位地址：</td>
        <td colspan="3">
                <span name="organizations/organization/address">
				    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/address" />
		        </span>
        </td>
    </tr>
    <tr >
        <td align="right">归口管理部门：</td>
        <td colspan="1">
            <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  id="recomend_org" showPattern="all" shieldPattern="0"
                      topCheckbox="false" onClick="initTreeValueExt" />
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" style="width: 80%;" class="required" value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
            <input type="hidden" name="proposal/recomend_org_name" style="width: 80%;" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
        </td>
        <td  align="right" ><span class="color_red">*</span>申报日期：</td>
        <td>
            <c:set var="submit_date">
                <x:out select="$xmlData/data/proposal/submit_date" />
            </c:set>
            <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
        </td>
    </tr>

    <tr >
        <td align="right">主导产业领域：</td>
        <td colspan="3">
            <c:set var="leading_industries_value"><x:out select="$xmlData/data/proposal/leading_industries_value" /></c:set>
            <c:set var="appl_sub_params">
                {'grant_code':'<x:out select="$xmlData/data/proposal/sub_grant_code" />','stat_year':'${param.statYear}'}
            </c:set>
            <input name="proposal/leading_industries_value" type="hidden" value="<x:out select="$xmlData/data/proposal/leading_industries_value" />" />
            <input name="proposal/leading_industries_name" type="hidden" value="<x:out select="$xmlData/data/proposal/leading_industries_name" />" class="required " label="主导产业领域" />
            <cpt:select style="width: 80%;" id="leading_industries" key="cyhjdba" className="selectWidth2" onChange="initControlValue('leading_industries');leadingOther()" value="${leading_industries_value}" sqlParamVal="${appl_sub_params}"></cpt:select>
               <input id="lead" maxlength="20" label="主导产业领域-->其他" <c:if test="${leading_industries_value eq 11}">style="display:block;width: 78.2%;" class="required" </c:if> <c:if test="${leading_industries_value ne 11}">style="display:none;width: 78.2%;"</c:if> name="proposal/leading_industries_other" value="<x:out select="$xmlData/data/proposal/leading_industries_other" />" >

        </td>
        </td>
    </tr>
</table>
    <table class="t_css" width="100%" id="base_case1" border="0" cellpadding="0"
           cellspacing="1">
    <tr>
        <td align="right" width="40%"  >企业数（家）：</td>
        <td align="left" width="10%" >
            <input onfocus="InitInput.setNumber(this,9,0,0)"  style="text-align: right;"name="proposal/cyh_enterprise" class="required" label="企业数" value="<x:out select="$xmlData/data/proposal/cyh_enterprise"/>" />
        </td>
        <td align="right" width="40%" >主导产业领域企业数（家）：</td>
        <td align="left" width="10%">
            <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/leading_subject_enterprise" class="required" label="主导产业领域企业数" value="<x:out select="$xmlData/data/proposal/leading_subject_enterprise"/>" />
        </td>
    </tr>
    <tr>
        <td align="right" >规上企业数（家）：</td>
        <td align="left">
            <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/scale_enterprise" class="required" label="规上企业数" value="<x:out select="$xmlData/data/proposal/scale_enterprise"/>" />
        </td>
        <td align="right" >高新技术企业数（家）：</td>
        <td align="left" >
            <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/high_tech_enterprise" class="required" label="高新技术企业数" value="<x:out select="$xmlData/data/proposal/high_tech_enterprise"/>" />
        </td>
    </tr>
    <tr>
        <td align="right" >省级以上创新平台总数（家）：</td>
        <td align="left" >
            <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/provincial_innovate_count" class="required" label="省级以上创新平台总数" value="<x:out select="$xmlData/data/proposal/provincial_innovate_count"/>" />
        <td align="right" >省级以上科技企业孵化器总数（家）：</td>
        <td align="left" >
            <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/provincial_technology_incubator_count" class="required" label="省级以上科技企业孵化器总数" value="<x:out select="$xmlData/data/proposal/provincial_technology_incubator_count"/>" />
        </td>
    </tr>

    <tr>
        <td align="right" >省级以上众创空间总数（家）：</td>
        <td align="left" >
            <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/provincial_maker_space_count" class="required" label="省级以上众创空间总数" value="<x:out select="$xmlData/data/proposal/provincial_maker_space_count"/>" />

        </td>
        <td align="right" >科技中介服务机构数（家）：</td>
        <td align="left" >
            <input onfocus="InitInput.setNumber(this,9,0,0)"  style="text-align: right;" name="proposal/technology_service_count" class="required" label="科技中介服务机构数" value="<x:out select="$xmlData/data/proposal/technology_service_count"/>" />

        </td>
    </tr>
    <tr>
        <td align="right" >技术经理人数（人）：</td>
        <td align="left" >
            <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/technical_manager" class="required" label="技术经理人数" value="<x:out select="$xmlData/data/proposal/technical_manager"/>" />

        </td>
        <td align="right" >科技型领军企业数（家）：</td>
        <td align="left" >
           <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/technology_leader_enterprise" class="required" label="科技型领军企业数" value="<x:out select="$xmlData/data/proposal/technology_leader_enterprise"/>" />

        </td>
    </tr>
    <tr>
        <td align="right" >科技型中小企业数（家）：</td>
        <td align="left">
            <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/technology_mid_small_enterprise" class="required" label="科技型中小企业数" value="<x:out select="$xmlData/data/proposal/technology_mid_small_enterprise"/>" />
        </td>
        <td align="right" >区域内研究与试验发展（R&D）经费投入（万元）：</td>
        <td align="left" >
            <input onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" name="proposal/regional_funding_money" class="required" label="区域内研究与试验发展（R&D）经费投入" value="<x:out select="$xmlData/data/proposal/regional_funding_money"/>" />
        </td>
    </tr>
        </table>
<table class="t_css" width="100%" id="base_case2" border="0" cellpadding="0"
       cellspacing="1">
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>

    <tr>
        <td align="right">是否设有科技成果转移转化专门管理服务机构：</td>
        <td  align="center" class="li_2">
            <c:set var="technology_achievements_change_manage_service_value"><x:out select="$xmlData/data/proposal/technology_achievements_change_manage_service_value"/></c:set>
            <cpt:select id="technology_achievements_change_manage_service" key="yesorno" style="width:100px" className="selectWidth2"  onChange="consolidatedValue(this.id);" value="${technology_achievements_change_manage_service_value}"></cpt:select>
            <input name="proposal/technology_achievements_change_manage_service_value" id="technology_achievements_change_manage_service_value" type="hidden" value="<x:out select="$xmlData/data/proposal/technology_achievements_change_manage_service_value" />"  />
            <input name="proposal/technology_achievements_change_manage_service_name" class="required" label="是否设有科技成果转移转化专门管理服务机构" id="technology_achievements_change_manage_service_name" type="hidden" value="<x:out select="$xmlData/data/proposal/technology_achievements_change_manage_service_name"/>"/>
        </td>
        <td align="right">科技成果转化管理服务机构人数（人）：</td>
        <td align="left">
            <input onfocus="InitInput.setNumber(this,9,0,0)" style="text-align: right;" name="proposal/technology_achievements_manage_service_count" class="required" label="科技成果转化管理服务机构人数" value="<x:out select="$xmlData/data/proposal/technology_achievements_manage_service_count"/>" />
        </td>
    </tr>
    <tr>
        <td rowspan="4" align="right">获得资质情况：</td>
        <td rowspan="2" align="right">国家级资质：</td>
        <td align="center">认定时间</td>
        <td align="center">认定资质名称</td>
    </tr>
    <tr >
        <td align="center">
            <c:set var="country_cognizance_date"><x:out select="$xmlData/data/proposal/country_cognizance_date"/></c:set>
            <cpt:date id="country_cognizance_date" name="proposal/country_cognizance_date" label="获得资质情况-->国家级资质-->认定时间" value="${country_cognizance_date }" className=" required  country_cognizance_date "></cpt:date>
        </td>
        <td align="center">
            <input type="text" maxlength="50" name="proposal/country_qualifications_name"  class="required" value="<x:out select="$xmlData/data/proposal/country_qualifications_name" />" label="获得资质情况-->国家级资质-->认定资质名称">

        </td>
    </tr>
    <tr >
        <td rowspan="2" align="right">省级资质：</td>
        <td align="center">认定时间</td>
        <td align="center">认定资质名称</td>
    </tr>
    <tr >
        <td align="center">
            <c:set var="provincial_cognizance_date"><x:out select="$xmlData/data/proposal/provincial_cognizance_date"/></c:set>
            <cpt:date id="provincial_cognizance_date" name="proposal/provincial_cognizance_date" label="获得资质情况-->省级资质-->认定时间" value="${provincial_cognizance_date }" className=" required  provincial_cognizance_date "></cpt:date>
        </td>
        <td align="center">

            <input type="text" maxlength="50" name="proposal/provincial_qualifications_name"  class="required" value="<x:out select="$xmlData/data/proposal/provincial_qualifications_name" />" label="获得资质情况-->省级资质-->认定资质名称">

        </td>
    </tr>
</table>
<br/>


<script type="text/javascript">
    $(function(){
        emerging_enterprises();
        industrial_enterprise();
        getLen();
    });


    function initTreeValueExt(treeId, treeNode) {
        if ((treeNode && treeNode.isParent)) {
            scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
            $("#" + treeId).val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            str = obj.name + "-" + str;
            obj = obj.parentNode;
        }

        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
    }

    function getLen() {
        var len=$("#tblorg_hzs tr:gt(1)").length;
        if(len>=1){
            $("#if_have_org").val("1");
        }else{
            $("#if_have_org").val("0");
        }
    }

    function industrial_enterprise() {
        var industrial_enterprise_value = $("#industrial_enterprise_value").val();
        if(industrial_enterprise_value==0){
            $("#industrial_value").val(1);
        }else if(industrial_enterprise_value==1){
            $("#industrial_value").val(0);
        }else {
            $("#industrial_value").val("");
        }

    }

    function emerging_enterprises() {
        var emerging_enterprises_value = $("#emerging_enterprises_value").val();
        if (emerging_enterprises_value == "0") {
            $("#emerging_industries_value_div").attr("style","display:block");
            $("#emerging_industries_value").addClass("required");
        } else{
            $("#emerging_industries_value_div").attr("style","display:none");
            $("input[name='proposal/emerging_industries_value']").val('');
            $("input[name='proposal/emerging_industries_name']").val('');
            $("#checkbox_dyn_emerging_industries").find("td input[type='checkbox']").attr("checked",false);
            $("#emerging_industries_value").removeClass("required")
        }
    }

    function setCooperationUnits(){
        var cooperation_units="";
        $("#tblorg_hzs tr:gt(1)").each(function(index){
            var cooperation_unit = $(this).find("td:eq(2) input").val().trim();
            /*var orgName = $("#org_name").val().trim();*/
            var orgName = $('span[name$="organizations/organization/org_name"]').html()
            if(!isBlankOrNull(cooperation_unit) && cooperation_unit!=orgName){
                cooperation_units += cooperation_unit+",";
            }
            /* if(!isBlankOrNull(cooperation_unit)){
                 cooperation_units += cooperation_unit+",";
             }*/
        });
        if(cooperation_units!=""){
            cooperation_units=cooperation_units.substring(0,cooperation_units.length-1);
        }
        $("#cooperation_units").val(cooperation_units);
    }
    function initSubjectTreeValueExp(treeId, treeNode) {
        /*if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
            scmWarn($("#" + treeId).attr("label") + "不能选择第一级，请选择它的子级！");
            if (treeNode.level == null) {
                $("#" + treeId).val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            }
            return false;
        }*/
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(treeNode.name.substring(treeNode.name.indexOf(".") + 1));
        //触发研究方向
        //checkDisCodeExp(treeNode.id,treeId,true); //下拉树
        //checkDisCodeSelect(treeNode.id,treeId,true);
    }

    function synchronizationAmount1(){
        var built_institute=$("#built_institute").val();
        if(built_institute !=  ""){
            $("span[id='built_institute_[00]']").html($("#built_institute").val());
            /*$("#total_fund_18").val(parseFloat($("#request_amount").val()).toFixed(2));*/
        }else if(built_institute ==  ""){
            $("input[id='built_institute_[00]']").html("");
        }
    }
    function compare_age() {
        var end_date = $("#statYear").val();
        var birthday = $("#fzbirthday").val();

        var end_date_year = Number(end_date.substring(0,4));
        var birthday_year = Number(birthday.substring(0,4));

        /*var end_date_month = Number(end_date.substring(5,7));
        var birthday_month = Number(birthday.substring(5,7));

        var end_date_day = Number(end_date.substring(8));
        var birthday_day = Number(birthday.substring(8));*/

        var different_value = end_date_year - birthday_year -57;
        /*var different_value1 = end_date_month - birthday_month;
        var different_value2 = end_date_day - birthday_day;*/

        if(different_value > 0 ){
            $("#age").val(1);
        }else{
            $("#age").val(0);
        }
        //onchangeType2();

    }

</script>
